package com.itheima.reflect.myreflect2;

public class ReflectDemo1 {
    public static void main(String[] args) throws ClassNotFoundException {
        // 获取 class 对象
        // 1. Class 类中的静态方法 forName
        Class<?> clazz = Class.forName("com.itheima.reflect.myreflect2.Student");
        System.out.println(clazz);

        // 2.通过class属性来获取
        Class<Student> clazz2 = Student.class;
        System.out.println(clazz2);

        // 3.利用对象的getClass方法来获取class对象
        Student s = new Student();
        Class<? extends Student> clazz3 = s.getClass();
        System.out.println(clazz3);

        System.out.println(clazz == clazz2);
        System.out.println(clazz2 == clazz3);
    }
}
